]> dgit.raspbian.org Git - gnome-shell.git/commit
blur-effect: Fix framebuffer sizes when stage-view scaling is used
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 12 Feb 2020 22:02:14 +0000 (23:02 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 27 Mar 2020 22:31:56 +0000 (22:31 +0000)
commitdedbf0cb09ad9774e7c1cfc93b72eea93d452e8c
tree8521ceb0b71ffef88adc2188d4eeb7114096feb3
parente5b7462b94ae054a751aada2cd3c56734659b09e
blur-effect: Fix framebuffer sizes when stage-view scaling is used

When blurring only the actor (ACTOR mode), we don't want to apply any
scale, it looks fine without using the resource scale and it also seems
like `clutter_actor_continue_paint` in `paint_actor_offscreen` only
draws an unscaled texture anyway (ie. if the resource scale is 2, only a
quarter of the framebuffer is being drawn to).

In BACKGROUND mode though, we need to scale the framebuffer using the
scale factor of the stage view (ie. the final scale factor for the
monitor) because the content of the framebuffer we blit is scaled using
that factor. Also, since the framebuffer we blit belongs to a stage view
and only includes the contents of this view, we need to adjust the
stage-coordinates of the actor to be relative to the stage-view.

To make sure we don't have to get the transformed actor size or position
multiple times during one paint-run and don't have to carefully floor()
or ceil() widths and positions, store the size of the actor (which is
also the size of the framebuffer) and its position relative to the stage
view inside a ClutterActorBox.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1000
src/shell-blur-effect.c